package com.qst.crop.demo.service;

import com.qst.crop.demo.entity.Product;
import com.qst.crop.demo.mapper.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductService {

    @Autowired
    private ProductMapper productMapper;

    public Integer add(Product product){
        return productMapper.add(product);
    }

    public List<Product> select(String searchWord){
        return productMapper.select(searchWord);
    }

    public List<Product> selectAll(){
        return productMapper.selectAll();
    }

    public Integer delete(Product product){
        return productMapper.delete(product);
    }

    public Integer update(Product product){
        return productMapper.update(product);
    }

    public Product getProById(Long productId){
        return productMapper.getProById(productId);
    }

}
